
#*--encoding:UTF-8--*

'''
整理数据
'''
from common.helper import Helper
from db.mysql import MysqlClient

class Arrangement( object ):
    def __init__(self):
        self.mysql = MysqlClient()
        self.name = "尊享人生医疗保险（2018版）"

    def pullData(self, data={}):
        for item in Helper.selectData(self.name, self.mysql):
            data["name"] = self.name
            data["company"] = "横琴人寿"
            data["year"] = item["year"]
            data["socialSec"] = item["socialSec"]
            data["plan"] = "A计划" if item["plan"] == "1109" else "B计划"
            data["money"] = "100w" if item["plan"] == "1109" else "200w"
            data["expire"] = "1年"
            data["price"] = item["price"]

            Helper.mergeTable(self.name, self.mysql, data)
if __name__ == '__main__':
    a = Arrangement()
    a.pullData()